// 模块：员工
import axios from 'axios'
const modelUrl = '/system'
// 员工
export interface EmployeeReq {
  employeeId?: string
  employeeNumber: string
  employeeName: string
  employeeStatus: number
  entryDate: string
  quitDate: string
}
export interface EmployeeRes {
  currentPage?: number
  pageSize?: number
  totalPage?: number
  totalCount?: number
  list: EmployeeResItem[]
}
export interface EmployeeResItem {
  index?: number
  employeeId: string
  employeeNumber: string
  employeeName: string
  employeeStatus: number
  entryDate: string
  quitDate?: string
  createdDt: string
}
export interface EmployeeListSearch {
  employeeName?: string
  employeeStatus?: number
  orderBy?: number
}
export function editEmployee(data: EmployeeReq) {
  return axios.post<EmployeeRes>(modelUrl + '/employeeAdit', data)
}

export function delEmployee(data: { employeeId: string }) {
  return axios.post<object>(modelUrl + '/employeeDel', data)
}

export function getEmployeeDetail(data: { employeeId: string }) {
  return axios.post<EmployeeRes>(modelUrl + '/employeeDetail', data)
}

export function getEmployeeAllList(data?: EmployeeListSearch) {
  return axios.post<EmployeeRes>(modelUrl + '/employeeList', data)
}

export function getEmployeePageList(data: EmployeeListSearch) {
  return axios.post<EmployeeRes>(modelUrl + '/employeePage', data)
}

export function batchDelEmployee(data: { idList: string[] }) {
  return axios.post<EmployeeRes>(modelUrl + '/employeeDelBatch', data)
}
